export default {
  /**
   * 选择城市
   * @param {*} state
   * @param {*} cityInfo
   */
  selectCity(state, cityInfo) {
    state.cityName = cityInfo.cityName;
    state.cityId = cityInfo.cityId;

    try {
      localStorage.cityInfo = JSON.stringify(state);
    } catch (error) {}
  },
  /**
   * 切换首页顶部分类图标
   * @param {*} state
   * @param {*} field
   */
  selectField(state, field) {
    state.field = field;
    try {
      localStorage.cityInfo = JSON.stringify(state);
    } catch (error) {}
  },
};
